package operation;

import book.BookList;

import java.util.Scanner;

public class Borrow implements Io{
    @Override
    public void work(BookList bookList) {
        System.out.println("请输入您要借的书名");
        Scanner sc=new Scanner(System.in);
        String name=sc.nextLine();
        int size=bookList.getUsedSize();
        for(int i=0;i<size;i++){
            if(bookList.getBook(i).getName().equals(name)){
                System.out.println("有您要借的书");
                System.out.println(bookList.getBook(i));
            }
        }
        System.out.println("您要借的书不存在");
    }
}
